package com.aruba.rtmppushapplication;

import android.os.Bundle;
import android.view.SurfaceView;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.aruba.rtmppushapplication.push.PushHelper;

public class MainActivity extends AppCompatActivity {
    private SurfaceView svPreview;
    private PushHelper pushHelper;
    private String uri = "rtmp://192.168.0.137/myapp/mystream";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        svPreview = findViewById(R.id.sv_preview);
        pushHelper = new PushHelper(this, svPreview.getHolder());
    }

    public void startPush(View view) {
        pushHelper.startPush(uri);
    }

    public void stopPush(View view) {
        pushHelper.stopPush();
    }

    public void swtichCamera(View view) {
        pushHelper.swtichCamera();
    }
}
